package com.walle.common.exceptions;

/**
 * @Author: zhangjiapeng
 * @Date: 2018/5/11 14:05
 * @Description:
 */
public class SystemException extends BaseException {

    private static final long serialVersionUID = -5875371379845226068L;

    public static final SystemException CODE_HAS_EXIST = new SystemException(10040001, "编码已经存在");
    public static final SystemException NAME_HAS_EXIST = new SystemException(10040002, "名称已经存在");

    public SystemException(int code, String msgFormat, Object... args) {
        super(code,String.format(msgFormat, args));
    }
    public SystemException(String message) {
        super(message);
    }

    public SystemException(String message, Throwable cause) {
        super(message, cause);
    }

    /**
     * 实例化异常
     */
    public SystemException newInstance(String msgFormat, Object... args) {
        return new SystemException(this.code, msgFormat, args);
    }

}
